package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.Salary;
import cn.wolfcode.crm.mapper.SalaryMapper;
import cn.wolfcode.crm.page.PageResult;
import cn.wolfcode.crm.query.SalaryQueryObject;
import cn.wolfcode.crm.service.ISalaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SalaryServiceImpl implements ISalaryService {

    @Autowired
    private SalaryMapper salaryMapper;

    public PageResult query(SalaryQueryObject qo) {

        int total = salaryMapper.queryForCount(qo);

        if (total==0){
            return new PageResult();
        }
        List<Salary> list = salaryMapper.queryForList(qo);
        return new PageResult(total,list);
    }
}
